package com.cloudwise.thread;

import lombok.SneakyThrows;
import org.apache.poi.ss.formula.functions.T;

import java.util.Date;
import java.util.concurrent.TimeUnit;

/**
 * @author ：Teacher陈
 * @date ：Created in 2021/1/5 15:16
 * @description：测试线程
 * @modified By：
 * @version: 1
 */
public class ThreadTest  implements   Runnable {
    @SneakyThrows
    @Override
    public void run() {
        for (int i = 1; i < 10; i++) {
            TimeUnit.SECONDS.sleep(1);
            System.out.println(Thread.currentThread().getName());

        }


    }


    public static void main(String[] args) throws InterruptedException {
        ThreadTest threadTest = new ThreadTest();
        Thread thread0 = new Thread(threadTest);
        Thread thread1 =new Thread(threadTest);
        thread0.start();
        //thread0.join();
        thread1.start();
       // thread1.join();
    }
}
